|
FORMAT is a function in Common Lisp that can produce formatted text using a format string similar to the printf format string. It provides more functionality than printf , allowing the user to output numbers in English, apply certain format specifiers only under certain conditions, iterate over data structures, and output in a tabular format. This functionally originates in MIT's Lisp Machine Lisp, where it was based on Multics ioa_ .==Example== An example of a C printf call is the following:Using Common Lisp, this is equivalent to: Another example would be to print every element of list delimited with commas, which can be done using the ~ directives:〔(18. A Few FORMAT Recipes ) from Practical Common Lisp〕 Note that not only is the list of values iterated over directly by FORMAT , but the commas correctly are printed ''between'' items, not ''after'' them. A yet more complex example would be printing out a list using customary English phrasing:Whilst FORMAT is somewhat infamous for its tendency to become opaque and hard to read, it provides a remarkably concise yet powerful syntax for a specialised and common need.〔抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Format (Common Lisp)」の詳細全文を読む スポンサード リンク
|